home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel
/
CAROUSEL.cdr
/
mactosh
/
util
/
simulare.sit
/
Simula 4.07 Reference
/
card_45070.txt
< prev
next >
Wrap
Text File
|
1989-05-02
|
3KB
|
147 lines
-- card: 45070 from stack: in.07 Reference
-- bmap block id: 0
-- flags: 0000
-- background id: 13647
-- name:
-- part 1 (field)
-- low flags: 00
-- high flags: 0000
-- rect: left=14 top=94 right=314 bottom=495
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name:
-- part 2 (button)
-- low flags: 00
-- high flags: A004
-- rect: left=351 top=290 right=312 bottom=435
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Simset
----- HyperTalk script -----
on mouseUp
go to card id 29187
end mouseUp
-- part 3 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=219 top=295 right=314 bottom=248
-- title width / last selected line: 0
-- icon id / first selected line: 1014 / 1014
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
visual effect wipe down
go to previous card
end mouseUp
-- part 4 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=252 top=295 right=314 bottom=278
-- title width / last selected line: 0
-- icon id / first selected line: 1013 / 1013
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: c
----- HyperTalk script -----
on mouseUp
visual effect wipe up
go to next card
end mouseUp
-- part 5 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=462 top=290 right=313 bottom=492
-- title width / last selected line: 0
-- icon id / first selected line: 1012 / 1012
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
----- HyperTalk script -----
on mouseUp
domenu "back"
end mouseUp
-- part contents for background part 2
----- text -----
Use of Simset
-- part contents for background part 1
----- text -----
Customers in line in front of a counter in a post office:
-- part contents for card part 1
----- text -----
Simset begin
class Counter(ServiceTime); real ServiceTime;
begin ref(Head) WaitingLine;
procedure Service(C); ref(Customer) C; ...; ! -- service a customer;
WaitingLine :- new Head;
end;
Link class Customer(ArrivalTime); real ArrivalTime;;
ref(Counter)TheCounter; ref(Customer) C;
real Time;
TheCounter :- new Counter(10);
while Time<1000 do
begin
C :- new Customer(Time); C.Into(TheCounter.WaitingLine);
if not TheCounter.WaitingLine.Empty and ...the clerk not busy... then
begin C :- TheCounter.WaitingLine.First; TheCounter.Service(C); C.Out; end;
Time := Time+1;
end;